money1 = input("请输入本金：")
money2 = int(money1)
year = 1
while money2 < 20000:
    money3 = money2 * 0.05
    money2 = money2 + money3
    print("第%d年利息为：%d,本金为：%d" % (year, money3, money2 - money3))
    year += 1
else:
    print("需要%d年，%s+%d>=20000" % (year, money1, money2 - int(money1)))


